package com.itheima.pattern.memorandum.white_box;

public class Client {
    public static void main(String[] args) {
        System.out.println("大战boss前：");

        GameRole gameRole = new GameRole();
        gameRole.initState();
        gameRole.stateDisplay();

        RoleStateCaretaker caretaker = new RoleStateCaretaker();
        caretaker.setRoleStateMemento(gameRole.saveState());

        System.out.println("大战boss后：");

        gameRole.fight();
        gameRole.stateDisplay();


        System.out.println("恢复状态：");
        gameRole.recoverState(caretaker.getRoleStateMemento());
        gameRole.stateDisplay();


    }
}
